import {requireAuth} from 'app/utils'
import {common} from 'app/reducers'
import configureStore from "app/store/configureStore";
const store=configureStore(window.__INITIAL_STATE__)
store.subscribe(() => {
  let state = store.getState();   //这就是你获取到的数据state tree，由于使用了subscribe，当数据更改时会重新获取
 // console.log(state,1234)
});
let state = store.getState();  
//console.log(state,12345)


export default {
    path: '/my',
    component: require('./index').default,
    
    indexRoute: {
      getComponent(state, cb){
        require.ensure([], require => cb(null, require('./Home').default))
    } 
  },
    childRoutes: [
      {
        path: 'calendar',//日历
        getComponent(state, cb){
          require.ensure([], require => cb(null, require('./Calendar').default))
        },
        onEnter: requireAuth,
      },
      {
        path: 'income',//收入统计
        getComponent(state, cb){
          require.ensure([], require => cb(null, require('./Income').default))
        },
        onEnter: requireAuth,
      },
      {
        path: 'bindBankCard',//绑定银行卡
        getComponent(state, cb){
          require.ensure([], require => cb(null, require('./BindBankCard').default))
        },
        onEnter: requireAuth,
      },
      {
        path: 'bankCard',//银行卡展示
        getComponent(state, cb){
          require.ensure([], require => cb(null, require('./AccountManage/BankCard').default))
        },
        onEnter: requireAuth,
      },
      {
        path: 'editPwd',//修改支付密码
        getComponent(state, cb){
          require.ensure([], require => cb(null, require('./AccountManage/EditPwd').default))
        },
        onEnter: requireAuth,
      },
      {
        path: 'accountManage',//用户管理
        getComponent(state, cb){
          require.ensure([], require => cb(null, require('./AccountManage').default))
        },
        onEnter: requireAuth,
      },
      {
        path: 'recharge', //充值
        getComponent(state, cb){
          require.ensure([], require => cb(null, require('./Recharge').default))
        },
        onEnter: requireAuth,
      },
      {
        path: 'withdraw', //提现
        getComponent(state, cb){
          require.ensure([], require => cb(null, require('./Withdraw').default))
        },
        onEnter: requireAuth,
      },
      {
        path: 'investRecord', //投资记录
        getComponent(state, cb){
          require.ensure([], require => cb(null, require('./InvestRecord').default))
        },
        onEnter: requireAuth,
      },
      {
        path: 'myRewards', //我的优惠
        getComponent(state, cb){
          require.ensure([], require => cb(null, require('./MyRewards').default))
        },
        onEnter: requireAuth,
      },
      {
        path: 'rewardsRule', //我的优惠规则说明
        getComponent(state, cb){
          require.ensure([], require => cb(null, require('./RewardsRule').default))
        },
        onEnter: requireAuth,
      },
      
      {
        path: 'capitalFlow', //资金流水
        getComponent(state, cb){
          require.ensure([], require => cb(null, require('./CapitalFlow').default))
        },
        onEnter: requireAuth,
      },
      {
        path: 'invite', //邀请
        getComponent(state, cb){
          require.ensure([], require => cb(null, require('./Invite').default))
        },
        onEnter: requireAuth,
      },
      {
        path: 'Risktest', //测评
        getComponent(state, cb){
          require.ensure([], require => cb(null, require('./AccountManage/Risktest').default))
        },
        onEnter: requireAuth,
      },
      {
        path: 'bindBank', //绑定银行卡 开户 江西银行
        getComponent(state, cb){
          require.ensure([], require => cb(null, require('./BindBank').default))
        },
        onEnter: requireAuth,
      } ,
      {
        path: 'userBindBankCard', //绑定银行卡
        getComponent(state, cb){
          require.ensure([], require => cb(null, require('./UserBindBankCard').default))
        },
        onEnter: requireAuth,
      }
      ,
      {
        path: 'rechargInfo', //充值说明
        getComponent(state, cb){
          require.ensure([], require => cb(null, require('./RechargInfo').default))
        },
        onEnter: requireAuth,
      }
      
      
      
    ]
  }

  
  